package com.junsi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.junsi.bean.Audits;
import com.junsi.mapper.AuditsMapper;
import com.junsi.service.AuditsService;

@Service
@Transactional(rollbackFor = Exception.class)
public class AuditsServiceImpl implements AuditsService{
	@Autowired
	public AuditsMapper auditsMapper;
	@Override
	public List<Audits> listAll() {
	   List<Audits> audits=auditsMapper.listAll();
		return audits;
	}

	@Override
	public Audits findById(Integer id) {
		Audits audits=auditsMapper.findById(id);
		return audits;
	}

	@Override
	public boolean insert(Audits o) throws Exception {
		int result = auditsMapper.insert(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean update(Audits o) throws Exception {
		int result = auditsMapper.update(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean delete(Integer id) {
		int result = auditsMapper.delete(id);
		if (result == 1) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean updateAll(Audits audits) {
		int result = auditsMapper.updateAll(audits);
		if (result == 1) {
			return true;
		} else {
			return false;
		}
	}

	

}
